import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '../views/Layout' // 首页
import Article from '../views/Article' // 面经
import Collect from '../views/Collect' // 收藏
import Like from '../views/Like' // 喜欢
import User from '../views/User' // 我的
import searchAdd from '../views/searchAdd.vue'
import ArticleDetail from '../views/ArticleDetail'
Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      children: [
        {
          path: '/Article', component: Article
        },
        {
          path: '/Collect', component: Collect
        },
        {
          path: '/Like', component: Like
        },
        {
          path: '/User', component: User
        }
      ]
    },
    {
      path: '/detail/:id', component: ArticleDetail
    },
    {
      path: '/searchAdd', component: searchAdd
    }

  ]
})

export default router
